﻿@using OSBLE.Models.Assignments;
@using OSBLE.Models;
@model Assignment
@section Header
{
<script src="@Url.Content("~/areas/AssignmentWizard/Content/js/deliverables.js")" type="text/javascript"></script>
}

<style type="text/css">
    .validation {
        color: red;
    }
    .disabled {
        background-color: #ffeeee;
    }
</style>

<p>@ToolTips.BasicAssignmentDeliverables</p>
@Html.ValidationSummary() 
@Html.HiddenFor(m => m.ID)
<table class="wizard_entry_table">
<tr>
    <th>@Html.LabelFor(m => m.IsAnnotatable):</th>
    <td>@Html.EditorFor(m => m.IsAnnotatable)</td>
    <td>@Html.ValidationMessageFor(m => m.IsAnnotatable)</td>
</tr>
</table>
<table id="deliverables_table" cellspacing="6px">
    <tr>
        <td>
            File&nbsp;Name
        </td>
        <td>
            <input type="text" id="new_deliverable_name" /> 
            <label id="new_deliverable_validation" class="validation" hidden="hidden" >The deliverable name is required.</label>
        </td>
    </tr>
    <tr>
        <td>
            Type
        </td>
        <td>
            <select id="new_deliverable_type">
                @foreach (SelectListItem dt in ViewBag.DeliverableTypes)
                {
                    <option value="@dt.Value">@dt.Text</option>
                }
            </select>
        </td>
    </tr>
</table>
    
<div id="add_deliverable_div">
    <a href="#" id="add_new_deliverable" title="Add New Deliverable" style="text-decoration: none;">
        <img src="@Url.Content("~/Content/images/add_up.png")" alt="Add New Deliverable" />
        Add this deliverable to the assignment </a>
    <label id="add_deliverable_validation" class="validation" hidden="hidden">Click 'add this deliverable to the assignment' Currently no deliverables are required listed in the assignment.  Conversely if you do not want deliverables, edit the assignment components and uncheck the box requiring deliverables.</label>
</div>
<div id="plugin_submission_validation_div">
    <label id="plugin_submission_validation" class="validation" hidden="hidden">PluginSubmissions are limited to 1 deliverable and only allow for file submission directly from the Visual Studio plugin. If this is not a programming assignment being submitted via the Visual Studio plugin, please remove the <strong>"PluginSubmission (.zip)"</strong> and select <strong>"Zip (.zip)"</strong> instead.</label>
</div>
<div id="deliverable_data">
</div>
    
<div id="deliverables_after">
</div>
    
<script type="text/javascript">
    $(function () {
        @foreach (Deliverable deliverable in Model.Deliverables)
        {
            <text>
            addNewDeliverable(true, { name: '@deliverable.Name', fileType: @deliverable.Type});
            </text>
        }
    });       
</script>
